import { Component, Output, Input, EventEmitter } from '@angular/core';

@Component({
  selector: 'app-modalBase',
  templateUrl: './modalBase.component.html',
  styleUrls: ['./modalBase.component.scss']
})
export class ModalBaseComponent {
  _show: boolean;
  @Output() showChange = new EventEmitter();
  @Output() onOpen = new EventEmitter();
  @Output() onClose = new EventEmitter();

  @Input()
  get show() {
    return this._show;
  }
  set show(val) {
    this._show = val;
    this.showChange.emit(this._show);
    if (!!val) {
      this.onOpen.emit(this);
    } else {
      this.onClose.emit(this);
    }
  }

  constructor() { }

}
